package com.zf.bm.common.core.sys.utils;

import com.google.common.collect.Lists;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SysUtils {
    private SysUtils() {
    }

    /**
     * list封装成map
     * @param list
     * @return
     */
    public static List<Map<String, Object>> boxListResult(List<OperateType> list) {
        List<Map<String, Object>> maps = Lists.newArrayList();
        for (int i = 0; i < list.size(); i++) {
            Map<String, Object> map = new HashMap<>(2);
            map.put("value", list.get(i).getValue());
            map.put("label", list.get(i).getMappingName());
            maps.add(map);
        }
        return maps;
    }
}
